# config.py

# RetinaNet face #

cfg_retina_mobilenet = {
    'name': 'mobilenet0.25',
    'min_sizes': [[16, 32], [64, 128], [256, 512]],
    'steps': [8, 16, 32],
    'variance': [0.1, 0.2],
    'clip': False,
    'loc_weight': 2.0,
    'ngpu': 1,
    'gpu_train': True,
    'batch_size': 4,
    "cpu": False,
    'epoch': 250,
    'decay1': 190,
    'decay2': 220,
    'image_size': 640,
    'pretrain': True,
    'return_layers': {'stage1': 1, 'stage2': 2, 'stage3': 3},
    'in_channel': 32,
    'out_channel': 64
}

cfg_retina_resnet50 = {
    'name': 'resnet50',
    'min_sizes': [[16, 32], [64, 128], [256, 512]],
    'steps': [8, 16, 32],
    'variance': [0.1, 0.2],
    'clip': False,
    'loc_weight': 2.0,
    "cpu": False,
    'ngpu': 1,
    'gpu_train': True,
    'batch_size': 1,
    'epoch': 100,
    'decay1': 70,
    'decay2': 90,
    'image_size': 840,
    'pretrain': True,
    'return_layers': {'layer2': 1, 'layer3': 2, 'layer4': 3},
    "vis_threshold": 0.4,  # inference face score vis threshold
    'in_channel': 256,
    'out_channel': 256
}

cfg_retina_ghost = {
    'name': 'ghost',
    'variance': [0.1, 0.2],  # variances of prior boxes, 0.1 -> center_x, center_y; 0.2 -> wh
    "width_mult": 0.5,  # ghost net width
    "in_channel": 20,  # FPN inchannels
    "out_channel": 40,  # head inchannels
    "num_keypoints": 5,
    # is or not gpu train
    "image_size": 640,
    'ngpu': 1,
    "gpu_train": True,  # is or not gpu train
    "batch_size": 2,  # train batch size
    "epoch": 250,  # train epoches
    # learning rate decay
    "decay1": 190,
    "decay2": 220,
    # prior box
    'min_sizes': [[16, 32], [64, 128], [256, 512]],
    'steps': [8, 16, 32],
    'clip': False,
    'loc_weight': 2.0,  # bounding box loss weight
    "vis_threshold": 0.4,  # inference face score vis threshold
    "cpu": False,  # use cpu or gpu inference
}

cfg_retina_rfb = {
    'name': 'RFB',
    'min_sizes': [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]],
    'steps': [8, 16, 32, 64],
    'variance': [0.1, 0.2],
    'clip': False,
    'loc_weight': 2.0,
    'ngpu': 1,
    'gpu_train': True,
    'batch_size': 32,
    "cpu": False,
    'epoch': 250,
    'decay1': 190,
    'decay2': 220,
    'image_size': 416
}

cfg_retina_slim = {
    'name': 'slim',
    'min_sizes': [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]],
    'steps': [8, 16, 32, 64],
    'variance': [0.1, 0.2],
    'clip': False,
    'loc_weight': 2.0,
    'ngpu': 1,
    'gpu_train': True,
    'batch_size': 32,
    "cpu": False,
    'epoch': 250,
    'decay1': 190,
    'decay2': 220,
    'image_size': 416
}

# CenterNet face

cfg_center_rfb = {
    'name': 'RFB',
    "in_channels": 128,
    "head_conv": 32,
    "num_keypoints": 5,
    'variance': [0.1, 0.2],
    'gpu_train': True,
    'batch_size': 4,
    'ngpu': 1,
    'epoch': 250,
    'decay1': 190,
    'decay2': 220,
    'image_size': 640,
    "init_weights": True,
    "num_layers": 18,
    'min_sizes': [[16, 32], [64, 128], [256, 512]],
    'steps': [8, 16, 32],
    'clip': False,
    'loc_weight': 2.0,
    'pretrain': True,
    "down_ratio": 4,
    "cpu": False,
    "vis_threshold": 0.3,
    "topk": 50
}

cfg_center_resnet18 = {
    "name": "resnet18",
    "in_channels": 256,
    "head_conv": 64,
    "num_keypoints": 5,
    "init_weights": True,
    "num_layers": 18,
    "image_size": 640,
    "gpu_train": True,
    "batch_size": 2,
    "ngpu": 1,
    "epoch": 250,
    "decay1": 190,
    "decay2": 220,
    'min_sizes': [[16, 32], [64, 128], [256, 512]],
    'steps': [8, 16, 32],
    'clip': False,
    'loc_weight': 2.0,
    'pretrain': True,
    "down_ratio": 4,
    "cpu": False,
    "vis_threshold": 0.3,
    "topk": 50
}

cfg_center_resnet50 = {
    "name": "resnet50",
    "in_channels": 256,
    "head_conv": 64,
    "num_keypoints": 5,
    "init_weights": True,
    "num_layers": 18,
    "image_size": 640,
    "gpu_train": True,
    "batch_size": 2,
    "ngpu": 1,
    "epoch": 250,
    "decay1": 190,
    "decay2": 220,
    'min_sizes': [[16, 32], [64, 128], [256, 512]],
    'steps': [8, 16, 32],
    'clip': False,
    'loc_weight': 2.0,
    'pretrain': True,
    "down_ratio": 4,
    "cpu": False,
    "vis_threshold": 0.6,
    "topk": 50
}

cfg_center_ghost = {
    "name": "ghost",
    "width_mult": 0.25,
    # "in_channels": 320,  # width_mult = 1
    # "head_conv": 80,
    "in_channels": 80,  # width_mult = 0.25
    "head_conv": 20,
    "num_keypoints": 5,
    "init_weights": True,
    "num_layers": 18,
    "image_size": 640,
    "gpu_train": True,
    "batch_size": 2,
    "ngpu": 1,
    "epoch": 250,
    "decay1": 190,
    "decay2": 220,
    'min_sizes': [[16, 32], [64, 128], [256, 512]],
    'steps': [8, 16, 32],
    'clip': False,
    'loc_weight': 2.0,
    'pretrain': True,
    "down_ratio": 4,
    "cpu": False,
    "vis_threshold": 0.3,
    "topk": 50,

}
